package vek.GUI;

import vek.GUI.MapView.ScrollableView;
import vek.GUI.Infoview.InfoView;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BoxLayout;
import javax.swing.JPanel;

/**
 * This class contains the main Scrollable map and the InfoView which is the info shown when a POI is clicked.
 * This Class is merely a sort of container for the ScrollView and the InfoView, and is used for layout purposes.
 * 
 * @author Christian, Michal og Jakob (Hold 1, gruppe 2)
 */
public class CentralPanelView extends JPanel
{        
        private Dimension prefferedSize;
        private Dimension screenSize;
        
        private ScrollableView scrollableView;
        private InfoView infoView;
        private BoxLayout layout;
        
    /**
     * Creates the CentralPaneView and sets its settings
     * @param size the preffered size of this component
     * @param sv the scrollable view which this component contains
     * @param iv the infoview which this component contains
     * @param scrSize the screen size of this terminal
     */

    public CentralPanelView(Dimension size, ScrollableView sv, InfoView iv, Dimension scrSize)
    {
        prefferedSize = size;
        scrollableView = sv;
        infoView = iv;
        screenSize = scrSize;
                
        layout = new BoxLayout(this, BoxLayout.Y_AXIS);
        
        setPreferredSize(prefferedSize);
        setBackground(new Color(0,0,0));
        
        addContent();
        setLayot();
        
    }
    
    /**
     * sets the layout for the JComponent
     */
    
    private void setLayot()
    {
        setLayout(layout);
    }
    
    /**
     * Adds JComponents to this JComponent.
     */
    
    private void addContent()
    {
        add(infoView);
        add(scrollableView);
        
    }

}
